function uncurrying(fn) {
  return (...args) => {
    args.forEach(item => {
      fn = fn(item)
    })
    return fn
  }
}

const add = a => b => c => d => {
  return a + b + c + d
}

const r = uncurrying(add)(1, 2, 3, 4)
console.log(r) // 10
